package com.bailiban.aigou.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.bailiban.aigou.dao.ProductDao;
import com.bailiban.aigou.entity.Product;
import com.bailiban.aigou.service.IProductService;
import com.bailiban.aigou.utils.PageModel;

@Service
public class ProductServiceImpl implements IProductService {
	
	@Autowired
	private ProductDao productDao;

	@Override
	@Transactional
	public void addProduct(Product product) {
		productDao.addProduct(product);
	}

	@Override
	@Transactional
	public PageModel<Product> getProducts(PageModel<Product> pageModel, Product product) {
		return productDao.getProducts(pageModel, product);
	}

	@Override
	@Transactional
	public void deleteProduct(Product product) {
		productDao.deleteProduct(product);
	}

}
